package com.wing.purchase.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.common.utils.JsonResult;
import com.wing.purchase.model.entity.SupplierInfo;
import com.wing.purchase.model.request.SupplierDetailExcelInForm;
import com.wing.purchase.model.request.SupplierInfoForm;
import com.wing.purchase.model.response.SupplierInfoVO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 供应商表-Service
 *
 * @author
 */
public interface SupplierInfoService extends IService<SupplierInfo> {

    /**
     * 添加
     *
     * @param supplierInfoForm
     * @return
     */
    int add(SupplierInfoForm supplierInfoForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<SupplierInfoVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<SupplierInfoVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    SupplierInfoVO get4appById(Long id);

    SupplierInfoVO getCustomerInfo(Long subjectId, Long contactsId);


    /**
     * 模板下载
     * @param response
     * @param request
     * @throws IOException
     */
    void template(HttpServletResponse response, HttpServletRequest request) throws IOException;


    /**
     * 导入供应商
     * @param list
     * @return
     */
   JsonResult importExcel(List<SupplierDetailExcelInForm> list);


    /**
     * 同步所有供应商
      * @return
     */
   JsonResult getSupplierList();

    /**
     * 更新和新增畅捷通数据
     * @return
     */
   String updateAndSaveCjtSupplier(SupplierInfoForm supplierInfoForm,String operateType);

}
